<?php
/* @var $this ProductReservationController */
/* @var $model ProductReservation */
/* @var $form CActiveForm */
?>

<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'product-reservation-form',
	'enableAjaxValidation'=>false,
)); ?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php echo $form->errorSummary($model); ?>

	<div class="row">
		<?php echo $form->labelEx($model,'product'); ?>
		<?php echo $form->dropDownList($model, 'product', CHtml::listData(
                Product::model()->findAll(), 'id', 'name'),             
                array('prompt' => 'Select a Product')
                ); ?>
		<?php echo $form->error($model,'product'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'quantity'); ?>
		<?php echo $form->textField($model,'quantity'); ?>
		<?php echo $form->error($model,'quantity'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'date_to_purchase'); ?>
		<?php $this->widget('zii.widgets.jui.CJuiDatePicker', array(
            'model'=>$model,
            'attribute'=>'date_to_purchase',
            'name'=>'date5',
            'language'=>Yii::app()->language=='et' ? 'et' : null,
            'options'=>array(
            'changeMonth'=> true,
            'changeYear'=> true,
            'yearRange'=>'1960:2020',
            "dateFormat"=>'yy-mm-dd', // jquery plugin options
            'showAnim'=>'fold', // 'show' (the default), 'slideDown', 'fadeIn', 'fold'
            'showOn'=>'button', // 'focus', 'button', 'both'
            'buttonText'=>Yii::t('ui','Select form calendar'),
            'buttonImage'=>Yii::app()->request->baseUrl.'/images/calendar.png',
			'buttonImageOnly'=>true,
			 ),
            'htmlOptions'=>array(
            'style'=>'width:150px;vertical-align:top'
        )))?>
		<?php echo $form->error($model,'date_to_purchase'); ?>
	</div>

	<!--	
	<div class="row">
		<?php echo $form->labelEx($model,'total_amount'); ?>
		<?php echo $form->textField($model,'total_amount',array('size'=>9,'maxlength'=>9)); ?>
		<?php echo $form->error($model,'total_amount'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'date_time_created'); ?>
		<?php echo $form->textField($model,'date_time_created'); ?>
		<?php echo $form->error($model,'date_time_created'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'customer'); ?>
		<?php echo $form->textField($model,'customer'); ?>
		<?php echo $form->error($model,'customer'); ?>
	</div>
	!-->

	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->